<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class ResourcesController extends MX_Controller {

    function __construct()
	{
		parent::__construct();
    }

    function index(){
        echo 'nothing';
    }

    function changeBrowser(){
        $this->load->view('resources/change-ie6');
    }

    function rsrc_css($file){

        $name['style_sirak'] = md5('style_sirak');
        $name['chromestyle'] = md5('chromestyle');
        $name['login-box'] = md5('login-box');
        $name['sexybuttons'] = md5('sexybuttons');
        $name['style_siku'] = md5('style_siku');
        $name['style_su'] = md5('style_su');
        $name['style_login'] = md5('style_login');
        $name['style'] = md5('style');
        $name['style_sima'] = md5('style_sima');
        $name['jquery_cluetip'] = md5('jquery_cluetip');

        $name['screen_green'] = md5('screen_green');
        $name['screen_blue'] = md5('screen_blue');
        $name['screen_black'] = md5('screen_black');
        $name['screen_red'] = md5('screen_red');
        $name['datepicker'] = md5('datepicker');
        $name['visualize'] = md5('visualize');
        $name['jquery_wysiwyg'] = md5('jquery_wysiwyg');
        $name['jquery_fancybox'] = md5('jquery_fancybox');
        $name['ie'] = md5('ie');
        $name['tipsy'] = md5('tipsy');

        switch($file){
          case $name['style_sirak']: $data['original_name'] = 'style_sirak'; break;
          case $name['chromestyle']: $data['original_name'] = 'chromestyle'; break;
          case $name['login-box']: $data['original_name'] = 'login-box'; break;
          case $name['sexybuttons']: $data['original_name'] = 'sexybuttons'; break;
          case $name['style_siku']: $data['original_name'] = 'style_siku'; break;
          case $name['style_su']: $data['original_name'] = 'style_su'; break;
          case $name['style_login']: $data['original_name'] = 'style_login'; break;
          case $name['style']: $data['original_name'] = 'style'; break;
          case $name['style_sima']: $data['original_name'] = 'style_sima'; break;
          case $name['jquery_cluetip']: $data['original_name'] = 'jquery_cluetip'; break;

          case $name['screen_green']: $data['original_name'] = 'screen_green'; break;
          case $name['screen_blue']: $data['original_name'] = 'screen_blue'; break;
          case $name['screen_black']: $data['original_name'] = 'screen_black'; break;
          case $name['screen_red']: $data['original_name'] = 'screen_red'; break;
          case $name['datepicker']: $data['original_name'] = 'datepicker'; break;
          case $name['visualize']: $data['original_name'] = 'visualize'; break;
          case $name['jquery_wysiwyg']: $data['original_name'] = 'jquery_wysiwyg'; break;
          case $name['jquery_fancybox']: $data['original_name'] = 'jquery_fancybox'; break;
          case $name['ie']: $data['original_name'] = 'ie'; break;
          case $name['tipsy']: $data['original_name'] = 'tipsy'; break;

          default: $data['original_name'] = 'nothing'; break;
        }

        $this->load->view('css',$data);

    }

    function rsrc_javascript($file){

        $name['chrome'] = md5('chrome');
        $name['jquery'] = md5('jquery');
        $name['general'] = md5('general');
        $name['sirak'] = md5('sirak');
        $name['sima'] = md5('sima');
        $name['su'] = md5('su');
        $name['spmb'] = md5('spmb');
        $name['jquery_marquee'] = md5('jquery_marquee');
        $name['cufon-yui'] = md5('cufon-yui');
        $name['Vegur_400-Vegur_700_font'] = md5('Vegur_400-Vegur_700_font');
        $name['jquery_cluetip'] = md5('jquery_cluetip');
        $name['Gotham_Book_400_font'] = md5('Gotham_Book_400_font');

        $name['jquery-ui'] = md5('jquery-ui');
        $name['jquery_img_preload'] = md5('jquery_img_preload');
        $name['hint'] = md5('hint');
        $name['jquery_visualize'] = md5('jquery_visualize');
        $name['jquery_wysiwyg'] = md5('jquery_wysiwyg');
        $name['jquery_fancybox'] = md5('jquery_fancybox');
        $name['jquery_tipsy'] = md5('jquery_tipsy');
        $name['custom_green'] = md5('custom_green');
        $name['excanvas'] = md5('excanvas');

        switch($file){
          case $name['chrome']: $data['original_name'] = 'chrome'; break;
          case $name['jquery']: $data['original_name'] = 'jquery'; break;
          case $name['general']: $data['original_name'] = 'general'; break;
          case $name['sirak']: $data['original_name'] = 'sirak'; break;
          case $name['su']: $data['original_name'] = 'su'; break;
          case $name['spmb']: $data['original_name'] = 'spmb'; break;
          case $name['sima']: $data['original_name'] = 'sima'; break;
          case $name['jquery_marquee']: $data['original_name'] = 'jquery_marquee'; break;
          case $name['cufon-yui']: $data['original_name'] = 'cufon-yui'; break;
          case $name['Vegur_400-Vegur_700_font']: $data['original_name'] = 'Vegur_400-Vegur_700_font'; break;
          case $name['jquery_cluetip']: $data['original_name'] = 'jquery_cluetip'; break;
          case $name['Gotham_Book_400_font']: $data['original_name'] = 'Gotham_Book_400_font'; break;

          case $name['jquery-ui']: $data['original_name'] = 'jquery-ui'; break;
          case $name['jquery_img_preload']: $data['original_name'] = 'jquery_img_preload'; break;
          case $name['hint']: $data['original_name'] = 'hint'; break;
          case $name['jquery_visualize']: $data['original_name'] = 'jquery_visualize'; break;
          case $name['jquery_wysiwyg']: $data['original_name'] = 'jquery_wysiwyg'; break;
          case $name['jquery_fancybox']: $data['original_name'] = 'jquery_fancybox'; break;
          case $name['jquery_tipsy']: $data['original_name'] = 'jquery_tipsy'; break;
          case $name['custom_green']: $data['original_name'] = 'custom_green'; break;
          case $name['excanvas']: $data['original_name'] = 'excanvas'; break;

          default: $data['original_name'] = 'nothing'; break;
        }

        ///Need a Session instead?
        if($data['original_name'] == 'sirak'){
          $data['needSession'] = TRUE;
        }
        else{
          $data['needSession'] = FALSE;
        }

        $this->load->view('javascript',$data);

    }


}

